package com.bll.imple.mymienAction;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;


import com.bean.MymienBean;
import com.bll.Action;
import com.dao.MymienDao;
import com.jspsmart.upload.SmartUpload;

public class uploadMymienAction implements Action{
	public String execute(HttpServletRequest request,
			HttpServletResponse response) {
//   SmartUpload upload=new SmartUpload();
//   
//
//   upload.setMaxFileSize(1024*1024*10);
//   upload.setTotalMaxFileSize(1024*1024*50);
//   upload.setAllowedFilesList("jpg,txt,doc");
  
   
   String lujing=request.getParameter("lujing"); 
	MymienDao dao=new MymienDao();
	//int typeId=Integer.parseInt(request.getParameter("typeId"));
	int userId=Integer.parseInt(request.getSession().getAttribute("userId").toString());
	  
	  List<MymienBean> mymiens=dao.SelectAll(userId);
	  //int id=Integer.parseInt(request.getParameter("id"));
	  //System.out.println("id:"+id);
	  String values[]=request.getParameterValues("cbx");
	  //System.out.println("checkbox1:"+values.length);
	  if(values!=null&&values.length!=0){
	  for(int i=0;i<values.length;i++){
		  System.out.println("checkbox:"+values[i]);
	  }
	  }
//	  for(MymienBean bean:mymiens){
//		  System.out.println("checkbox:"+request.getParameter(bean.getId()+""));
//		 if(request.getParameter(bean.getId()+"")!=null){
//			 id=bean.getId();
//			 //break;
//		 }
//	 }
	 // MymienBean bean=dao.SelectById(id);
	// request.setAttribute("bean", bean);
	  
	return lujing;
         // return"";
	}
}
